package view;

import android.app.Notification;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.util.Log;

import utils.utils.NotificationUtil;

/**
 * Created by cd5160866 on 2017/10/27.
 */

public class InitService extends Service {

    @Override
    public void onCreate() {
        super.onCreate();
        Log.d("InitService", "服务创建");
        Notification notification = NotificationUtil.simpleService(getApplicationContext());
        startForeground(10, notification);
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        return START_STICKY;
    }
}
